package com.example.shopdemo.dto;

import com.example.shopdemo.entity.ProductCategory;
import com.example.shopdemo.enums.ProductCategoryStateEnum;
import lombok.Data;

import java.util.List;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2018-01-21
 **/
@Data
public class ProductCategoryExecution {

    private int state; //结果状态

    private String stateInfo;//状态标识

    private List<ProductCategory> productCategoryList;

    public ProductCategoryExecution(){}

    /**
     * 失败构造器
     * @param productCategoryStateEnum
     */
    public ProductCategoryExecution(ProductCategoryStateEnum productCategoryStateEnum){
        this.state = productCategoryStateEnum.getKey();
        this.stateInfo = productCategoryStateEnum.getValue();
    }

    /**
     * 成功构造器
     */
    public ProductCategoryExecution(ProductCategoryStateEnum productCategoryStateEnum,List<ProductCategory> productCategoryList){
        this.state = productCategoryStateEnum.getKey();
        this.stateInfo = productCategoryStateEnum.getValue();
        this.productCategoryList = productCategoryList;
    }
}
